#ifdef ECUT_MAIN

#include "TestMap.h"
#include "util/logger/Logger.h"
#include "util/logger/LoggerManager.h"

CPPUNIT_TEST_SUITE_REGISTRATION(TestMap);

void TestMap::setUp()
{
	util::LoggerManager::getInstanceConfigSafe()->getLogger();
	unMap = new Map();
	unMap->addIntersection("a");
	unMap->addIntersection("b");
	unMap->addIntersection("c");
	unMap->addIntersection("d");
	unMap->addRoad("Peron 0 al 100","Peron", "a", "b", 100, 100, Street, 0, 100);
	unMap->addRoad("Peron 100 al 0","Peron", "b", "a", 100, 100, Street, 100, 0);
	unMap->addRoad("Peron 100 al 200","Peron", "b", "c", 100, 100, Street, 100, 200);
	unMap->addRoad("Peron 200 al 100","Peron", "c", "b", 100, 100, Street, 200, 100);
}
void TestMap::testMapCreation()
{
	CPPUNIT_ASSERT(unMap);
	Route* path = unMap->route("Peron", 80, "Peron", 140, Distance);
	util::LinkedList<Intersection*>::Iterator* it = path->iterator();
	CPPUNIT_ASSERT(it->hasNext());
	it->next();
//	CPPUNIT_ASSERT(it->currentVertex()->getId() == "origin");
//	CPPUNIT_ASSERT(it->nextVertex()->getId() == "b");
//	CPPUNIT_ASSERT(it->hasNext());
	it->next();
//	CPPUNIT_ASSERT(it->nextVertex()->getId() == "destination");
	it->next();
	CPPUNIT_ASSERT(!it->hasNext());
}

#endif /* ECUT_MAIN */
